package EX3;
/*
    DataInputStream类 和 DataOutputStream类
    提供直接读写基本数据类型数据的方法，而不必关心它实际有几个字节
 */

import java.io.*;

public class demo1 {
    public static void main(String[] args) throws IOException {
        File f=new File("C:/filea/a.txt");

        DataOutputStream dos=new DataOutputStream(new FileOutputStream(f));
        for (int i = 0; i < 9; i++) {
            dos.writeInt(i);
        }
        dos.close();

        DataInputStream dis=new DataInputStream(new FileInputStream(f));
        for (int i = 0; i < 9; i++) {
            System.out.println(dis.readInt()+" ");
        }
        dis.close();
    }
}
